from django.db import models
from django.utils import timezone

class Reporter(models.Model):
    full_name = models.CharField(max_length = 70)
    password = models.CharField(max_length = 20)
    
    def __unicode__(self):
        return self.full_name

class Article(models.Model):
    pub_date = models.DateField()
    headline = models.CharField(max_length = 200)
    content = models.TextField()
    reporter = models.ForeignKey(Reporter)

    def __unicode__(self):
        return self.headline
    
    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days - 1)
